# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>

pkgname=php7-pecl-pcov
_pkgreal=pcov
pkgver=1.0.6
pkgrel=1
pkgdesc="Code coverage driver for PHP"
url="https://pecl.php.net/package/pcov"
arch="all"
license="PHP-3.01"
depends="php7-common"
makedepends="php7-dev autoconf re2c"
source="https://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir"/$_pkgreal-$pkgver

build() {
	cd "$builddir"
	phpize7
	./configure \
		--prefix=/usr \
		--with-php-config=php-config7
	make
}

check() {
	cd "$builddir"
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
	php7 -d extension="$builddir"/modules/$_pkgreal.so --ri $_pkgreal
}

package() {
	local confdir="$pkgdir/etc/php7/conf.d"
	cd "$builddir"

	make INSTALL_ROOT="$pkgdir" install

	mkdir -p "$confdir"
	echo "extension=$_pkgreal.so" > "$confdir"/$_pkgreal.ini
}

sha512sums="4e715ad52a89e2a3226b23520e8ea3410288de96c3a3a08840e94628f5e4d0716392188d72247751e4cd1327deb2a11269081c089d6a455d214adbec59d8632f  pcov-1.0.6.tgz"
